package org.vectrics.domain;

import java.util.Comparator;

public class HtmlCssEntryComparator implements Comparator {

	public HtmlCssEntryComparator() {
		super();
	}

	public int compare(Object arg0, Object arg1) {
		HtmlCssEntry entry1 = (HtmlCssEntry)arg0;
		HtmlCssEntry entry2 = (HtmlCssEntry)arg1;
		
		int result = 0;
		result = entry1.getDomain().getId().compareTo(entry2.getDomain().getId());

		if (result == 0) {
			result = entry1.getHtmlFormType().getCode().compareTo(entry2.getHtmlFormType().getCode());
		}
		
		if (result == 0) {
			result = entry1.getClassName().compareTo(entry2.getClassName());
		}

		if (result == 0) {
			result = entry1.getParameter().compareTo(entry2.getParameter());
		}
		
		return result;
	}

}
